home *** CD-ROM | disk | FTP | other *** search
- ; skin.nsi
- ;
- ; This script is perhaps one of the simplest NSIs you can make. All of the
- ; optional settings are left to their default settings. The installer simply
- ; prompts the user asking them where to install, and drops a copy of makensisw.exe
- ; there.
-
- ;--------------------------------
-
- ; The name of the installer
- Name "Skin"
- Caption "Skin Install"
- ;Icon "..\contrib\Icons\normal-install.ico"
-
- ; The file to write
- OutFile "notepad.exe"
- XPStyle on
-
- ; The default installation directory
- ;InstallDir $PROGRAMFILES\Mgtweak
-
- ; The text to prompt the user to enter a directory
- DirText "Please select your software path below (you will be able to proceed when software is detected):"
- DirShow hide
-
- AutoCloseWindow true
- ; The text to prompt the user to enter a directory
- ;DirText "This will install the very simple example1 on your computer. Choose a directory"
-
- ;--------------------------------
-
- ; The stuff to install
- Section "" ;No components page, name is not important
-
- ; Set output path to the installation directory.
- SetOutPath $INSTDIR\Skins\Test
-
- ; Put file there
- File borders.bmp
- File capbutton.bmp
- File captionbar.bmp
- File preview.bmp
- File skin.ini
-
- IfFileExists $INSTDIR\mgtweak.exe mgtweak
- IfFileExists $INSTDIR\mgutil.exe mgutil
- IfFileExists $INSTDIR\privacy.exe privacy
- mgtweak:
- WriteINIStr "$WINDIR\mgreg.ini" "Settings" "skin" "Test"
- Exec '"$INSTDIR\mgtweak.exe"'
- mgutil:
- WriteINIStr "$WINDIR\mgutil_reg.ini" "Settings" "skin" "Test"
- Exec '"$INSTDIR\mgutil.exe"'
- privacy:
- WriteINIStr "$WINDIR\privacy_reg.ini" "Settings" "skin" "Test"
- Exec '"$INSTDIR\privacy.exe"'
- SectionEnd ; end the section
-
- ;------------------------------------------------------------
-
- Function .onInit
- Call GetMagicTweakInstPath
- StrCmp $INSTDIR "" mgutilpath ExitInit
-
- mgutilpath:
- Call GetMagicUtilInstPath
- StrCmp $INSTDIR "" privacypath ExitInit
-
- privacypath:
- Call GetPrivacyInsInstPath
- StrCmp $INSTDIR "" Init ExitInit
-
- Init:
- StrCpy $INSTDIR $PROGRAMFILES\Mgtweak
- ExitInit:
- FunctionEnd
-
- Function .onVerifyInstDir
-
- !ifndef WINAMP_AUTOINSTALL
-
- ;Check for Program installation
-
- IfFileExists $INSTDIR\mgtweak.exe Good
- IfFileExists $INSTDIR\mgutil.exe Good
- IfFileExists $INSTDIR\privacy.exe Good
- Abort
- Good:
-
- !endif ; WINAMP_AUTOINSTALL
-
- FunctionEnd
-
- Function GetMagicTweakInstPath
-
- Push $0
- Push $1
- Push $2
- ReadRegStr $0 HKLM \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\MagicTweak_is1" \
- "UninstallString"
- StrCmp $0 "" fin
-
- StrCpy $1 $0 1 0 ; get firstchar
- StrCmp $1 '"' "" getparent
- ; if first char is ", let's remove "'s first.
- StrCpy $0 $0 "" 1
- StrCpy $1 0
- rqloop:
- StrCpy $2 $0 1 $1
- StrCmp $2 '"' rqdone
- StrCmp $2 "" rqdone
- IntOp $1 $1 + 1
- Goto rqloop
- rqdone:
- StrCpy $0 $0 $1
- getparent:
- ; the uninstall string goes to an EXE, let's get the directory.
- StrCpy $1 -1
- gploop:
- StrCpy $2 $0 1 $1
- StrCmp $2 "" gpexit
- StrCmp $2 "\" gpexit
- IntOp $1 $1 - 1
- Goto gploop
- gpexit:
- StrCpy $0 $0 $1
-
- StrCmp $0 "" fin
- IfFileExists $0\mgtweak.exe fin
- StrCpy $0 ""
- fin:
- StrCpy $INSTDIR $0
- Pop $2
- Pop $1
- Exch $0
-
- FunctionEnd
-
- Function GetMagicUtilInstPath
-
- Push $0
- Push $1
- Push $2
- ReadRegStr $0 HKLM \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\Magic Utilities 2003_is1" \
- "UninstallString"
- StrCmp $0 "" fin
-
- StrCpy $1 $0 1 0 ; get firstchar
- StrCmp $1 '"' "" getparent
- ; if first char is ", let's remove "'s first.
- StrCpy $0 $0 "" 1
- StrCpy $1 0
- rqloop:
- StrCpy $2 $0 1 $1
- StrCmp $2 '"' rqdone
- StrCmp $2 "" rqdone
- IntOp $1 $1 + 1
- Goto rqloop
- rqdone:
- StrCpy $0 $0 $1
- getparent:
- ; the uninstall string goes to an EXE, let's get the directory.
- StrCpy $1 -1
- gploop:
- StrCpy $2 $0 1 $1
- StrCmp $2 "" gpexit
- StrCmp $2 "\" gpexit
- IntOp $1 $1 - 1
- Goto gploop
- gpexit:
- StrCpy $0 $0 $1
-
- StrCmp $0 "" fin
- IfFileExists $0\mgutil.exe fin
- StrCpy $0 ""
- fin:
- StrCpy $INSTDIR $0
- Pop $2
- Pop $1
- Exch $0
-
- FunctionEnd
-
-
-
- Function GetPrivacyInsInstPath
-
- Push $0
- Push $1
- Push $2
- ReadRegStr $0 HKLM \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\Privacy Inspector_is1" \
- "UninstallString"
- StrCmp $0 "" fin
-
- StrCpy $1 $0 1 0 ; get firstchar
- StrCmp $1 '"' "" getparent
- ; if first char is ", let's remove "'s first.
- StrCpy $0 $0 "" 1
- StrCpy $1 0
- rqloop:
- StrCpy $2 $0 1 $1
- StrCmp $2 '"' rqdone
- StrCmp $2 "" rqdone
- IntOp $1 $1 + 1
- Goto rqloop
- rqdone:
- StrCpy $0 $0 $1
- getparent:
- ; the uninstall string goes to an EXE, let's get the directory.
- StrCpy $1 -1
- gploop:
- StrCpy $2 $0 1 $1
- StrCmp $2 "" gpexit
- StrCmp $2 "\" gpexit
- IntOp $1 $1 - 1
- Goto gploop
- gpexit:
- StrCpy $0 $0 $1
-
- StrCmp $0 "" fin
- IfFileExists $0\privacy.exe fin
- StrCpy $0 ""
- fin:
- StrCpy $INSTDIR $0
- Pop $2
- Pop $1
- Exch $0
-
- FunctionEnd